package personal.service.accounting;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import personal.dao.accounting.MonthwiseCalendarDAO;
import personal.domain.accounting.MonthwiseCalendar;


@Service
public class MonthwiseCalendarServiceImpl implements MonthwiseCalendarService {
	private MonthwiseCalendarDAO monthwiseCalendarDAO;

	public MonthwiseCalendarDAO getMonthwiseCalendarDAO() {
		return monthwiseCalendarDAO;
	}

	@Autowired(required=false)
	public void setMonthwiseCalendarDAO(MonthwiseCalendarDAO monthwiseCalendarDAO) {
		this.monthwiseCalendarDAO = monthwiseCalendarDAO;
	}

	@Override
	@Transactional(readOnly=true)
	public List<MonthwiseCalendar> getMonthwiseCalendarsForYear(Long year) {
		MonthwiseCalendar calendar = new MonthwiseCalendar();
		calendar.setMonth(year);
		return monthwiseCalendarDAO.getMonthwiseCalendars(calendar);
	}

}
